#include <stdio.h>
#include <unistd.h>
#include <signal.h>

volatile int flg = 0;
void change(int sig){
    flg = 1;
    printf("%s\n","flg由0->1");
}

int main(){
    signal(2,change);
    while(!flg);
    printf("%s\n","我是正常退出的");
    return 0;
}
